package com.adinall.dsp.core.data;

import java.io.Serializable;

import com.adinall.dsp.core.utils.StringUtils;

/**
 * Key-Value-Title Bean
 * 
 * @author 高万超
 * @version V1.0.0 $ 2017年9月19日 下午4:18:54
 */
public class KeyValueTitleBean<K extends Comparable<K>, V extends Comparable<V>> implements Serializable {

    private K key;
    private V value;
    private String title;

    public KeyValueTitleBean() {
    }

    public KeyValueTitleBean(K key, V value, String title) {
        this.key = key;
        this.value = value;
        this.title = title;
    }

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String toString() {

        StringBuilder buf = new StringBuilder();

        buf.append("{");
        buf.append("\"key\":");
        buf.append(key);
        buf.append(",");
        buf.append("\"value\":");
        buf.append(value);
        buf.append(",");
        buf.append("\"title\":");
        buf.append(title);
        buf.append("}");

        return StringUtils.toString(buf);
    }
}